<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style type="text/css">
			#da{
				width: 100%;
				display: flex;
				justify-content: center;
				margin-top: 200px;
			}
			#outdiv{
				width: 600px;
				height: 100px;
				background-color: aqua;
				display: flex;
				overflow: hidden;
				border: solid red 1px;
				
			}
			#tupian{
				width: 1100px;
				height: 300px;
				display: flex;
				
			}
			#tupian img{
				width: 100px;
				height: 100px;
			}
		</style>
	</head>
	<body>
		<div id="da">
			<div id="outdiv">
				<div id="tupian" onmouseenter="onmouseenterobj()" onmouseleave="onmouseleaveobj()">
					<img src="img/1.jpeg" >
					<img src="img/2.jpeg" >
					<img src="img/3.jpeg" >
					<img src="img/4.jpeg" >
					<img src="img/5.jpeg" >
					<img src="img/6.jpeg" >
					<img src="img/7.jpeg" >
					<img src="img/8.jpeg" >
					<img src="img/9.jpeg" >
					<img src="img/10.jpeg" >
					<img src="img/11.jpeg" >
					<img src="img/1.jpeg" >
					<img src="img/2.jpeg" >
					<img src="img/3.jpeg" >
					<img src="img/4.jpeg" >
					<img src="img/5.jpeg" >
					<img src="img/6.jpeg" >
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var tupianobj=document.getElementById('tupian');
		var margin=0;
		var myinteral=null;
		var settime;
		function zhixing(){
				if(margin==-1100){
					margin=0;
				}
					margin--;
					tupianobj.style.marginLeft=margin+'px';
			
		if(margin%100==0){
			clearInterval(myinteral);
			 settime=setTimeout(function(){
				myinteral=setInterval(zhixing,50);
			},1000)
		}
	}
		function onmouseenterobj(){
			clearInterval(myinteral);
		}
		function onmouseleaveobj(){
			clearInterval(settime);
			myinteral=setInterval(zhixing,50);
		}
		onload = function(){
			myinteral=setInterval(zhixing,50);
		}
	</script>
</html>
